package com.walter.learn.TestUtil;

import com.walter.learn.Util.QRCodeUtil;

/**
 * @ProjectName: learn
 * @Package: com.walter.learn.TestUtil
 * @ClassName: QRCodeUtilTest
 * @Author: DELL
 * @Description: ${description}
 * @Date: 2020/2/18 13:06
 * @Version: 1.0
 */
public class QRCodeUtilTest {
    public static void main(String[] args) {
        //生成二维码
        String content = "https://www.bilibili.com/video/av89816825/";
        String imgPath = "E:/Test/58-1.jpg";
        String destPath = "E:/Test";
        System.out.println("logo图片地址imgPath==" + imgPath);
        System.out.println("存放二维码图片的地址destPath==" + destPath);
        try {
            QRCodeUtil.encode(content, imgPath, destPath, true);
        } catch (Exception e1) {
            e1.printStackTrace();
        }
        //解析二维码
        String destPath1 = "E:/Test/82231.jpg";
        try {
            String result = QRCodeUtil.decode(destPath1);
            System.out.println(result);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(destPath1 + "不是二维码");
        }
    }
}
